﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using GalaSoft.MvvmLight.Messaging;
using Miris.HumanMilkAnalyser.WPF.Shared;
using Miris.HumanMilkAnalyser.WPF.ViewModel;

namespace Miris.HumanMilkAnalyser.WPF
{
    /// <summary>
    /// Interaction logic for UnassignedSampleNumberListPage.xaml
    /// </summary>
    public partial class UnassignedSampleNumberListPage : PageBase
    {
        public UnassignedSampleNumberListPage()
        {
            InitializeComponent();
            InitializePageUnloadStoryboard();
        }

        protected override void RegisterMessages()
        {
            base.RegisterMessages();

            RegisterDeleteDataConfirmMessageToken();
        }

        /// <summary>
        /// Register the DeleteDataConfirmMessage from UnassignedSampleNumberListViewModel.
        /// </summary>
        private void RegisterDeleteDataConfirmMessageToken()
        {
            Messenger.Default.Register<DialogMessage>(this, UnassignedSampleNumberListViewModel.DeleteDataConfirmMessageToken, dialog =>
            {
                var confirmResult = MessageBox.Show(dialog.Content, dialog.Caption, dialog.Button, dialog.Icon);
                dialog.ProcessCallback(confirmResult);
            });
        }
    }
}
